﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Data;

namespace PrototipoMVC3IU.Controllers
{
    public class AdministracionController : Controller
    {
        //
        // GET: /Administracion/

        public ActionResult AdministracionCentral()
        {
            return View();
        }

        [HttpPost]
        public ActionResult AdministracionCentral(FormCollection Collection)
        {
            string ButtonClick = Collection["ButtonClick"].ToString();
            string Opcion = Collection["OP"].ToString();
            switch (ButtonClick)
            {
                case "Detalles":
                    TempData["Opcion"] = Opcion;
                    return RedirectToAction("AdministracionDetalles");
                case "Volver":
                    return RedirectToAction("Inicio", "Inicio");
                default:
                    return View();
            }
        }

        public ActionResult AdministracionDetalles() 
        {
            ViewData["Opcion"] = TempData["Opcion"];
            return View();
        }

        [HttpPost]
        public ActionResult AdministracionDetalles(FormCollection Collection)
        {
            string ButtonClick = Collection["ButtonClick"].ToString();
            switch (ButtonClick)
            {
                case "Volver":
                    return RedirectToAction("AdministracionCentral");
                default:
                    return View();
            }
        }
    }
}
